//
//  EmoticonModel.swift
//  01-表情键盘
//
//  Created by 陈伟 on 15/10/25.
//  Copyright © 2015年 陈伟. All rights reserved.
//

import Foundation

class EmoticonModel: NSObject {
    
    var chs: String?
    
    var png: String?
    
    var pngPath: String? {
        if png != nil {
            return NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
        }
        return nil
    }
    var isRemoved = false
    
    var isEmpty = false
    
    init(isEmpty: Bool ) {
            self.isEmpty = isEmpty
            super.init()
    }
    
    init(isRemoved: Bool){
        self.isRemoved = isRemoved
        super.init()
    }
    
    var code: String? {
        didSet {
            emoji = code?.emoji
        }
    }
    
    var emoji: String?
    
    init(dict: [String: String]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) { }
    
    override var description:String {
        
        let keys = ["chs", "png", "pngPath", "code"]
        return dictionaryWithValuesForKeys(keys).description
    }
    
}